function [ hasThisTrait ] = hasCombinedTrait( copyDeltaProfile, trait)
	%needs to look for "trait" or a particular delta between copy numbers at a given site within the window that trait tends to occur within
	%make sure the input transitino is a transition code

    transition = trait(1, 1);
    startSite = trait(1, 2);
    startWin = trait(1, 3);
    endSite = trait(1, 4);
    endWin = trait(1, 5);
    
    hasThisTrait = 0;
    [from, to] = getTransitionFromCode(transition);
    numSites = size(copyDeltaProfile, 2);
    gotIn = 0;
    for i = max(1, startSite-startWin):max(1, min(size(copyDeltaProfile, 2), startSite+startWin))
        gotIn = 1;
        if (startSite ~= -1)
            [thisFrom, thisTo] = getTransitionFromCode(copyDeltaProfile(1, i));
        else
            thisFrom = from;
            thisTo = to;
        end
        if (thisFrom == 0 && thisTo == 0) continue; end
        incr = 1;
        if (thisFrom > thisTo) incr = -1; end
        n = thisFrom;
        while(n ~= thisTo)
            if (from == n && to == n+incr)
                thisEndSite = -1;
                for j = max(i, 1):numSites
                    if (copyDeltaProfile(1, j) ~= 0)
                        [endFrom, endTo] = getTransitionFromCode(copyDeltaProfile(1, j));
                        
                        if (startSite ~= -1 && ((from > to && endTo >= from) || (from < to && endTo <= from)))
                            thisEndSite = j;
                            break;
                        elseif (startSite == -1 && ((from > to && endFrom <= to && endTo >= to) || (from < to && endFrom >=to && endTo <= from)))
                            thisEndSite = j;
                            break;
                        end
%                         if (((from > to && endTo >= from) || (from < to && endTo <= from))&&(startSite ~= -1 || to == endFrom))
%                                 thisEndSite = j;
%                                 break;
%                         end
                    end
                end
%                 for j = 1:size(chrEndSites, 1)
%                     if (i <= chrEndSites(j, 1) && thisEndSite > chrEndSites(j, 1))
%                         thisEndSite = -1;
%                     end
%                 end
                
                if (endSite == -1 && thisEndSite == -1)
                    hasThisTrait = 1;
                    return;
                elseif (endSite ~= -1 && thisEndSite <= endSite + endWin && thisEndSite >= endSite - endWin)
                    hasThisTrait = 1;
                    return;
                end
            end
            n = n+incr;
        end
    end
    if (gotIn == 0)
        fprintf('Didnt get in!\n');
    end
end